#include <vector>
#include <iostream>

using namespace std;

const int N = 15;

int n, k;

bool st[N];
int a[N], b[N];

vector<int> path;

bool flag;

void dfs(int u)
{
	if (flag) return;
	if (u == n + 1)
	{
		flag = true;
		return ;
	}
	
	for (int i = 1; i <= n; i ++ )
	{
		if (st[i]) continue;
		st[i] = true;
		path.push_back(i);
		if (b[u] <= a[i]) dfs(u + 1);
		if (flag) return ;
		st[i] = false;
		path.pop_back();
	}
}

int main()
{
	cin >> n >> k;
	
	for (int i = 1; i <= n; i ++ ) cin >> a[i];
	for (int i = 1; i <= n; i ++ ) cin >> b[i];
	
	dfs(1);
	
	if (flag)
	{
		for (auto x : path) cout << x << ' ';
	}
	else puts("-1");
	
	return 0;
}